#include <stdio.h>
#include <stdlib.h>

int main()
{
	int i,a,b,c,n,t;
	char line[1000];
	FILE *fr,*fw;
	int inDegreeRank[100];
	for(i = 0;i < 100;i++)
		inDegreeRank[i] = 0;
	fr = fopen("wt2g_inlinks","r");
	while (fgets(line,1000,fr) != NULL)
	{
		char *cTemp = line;
		t = -1;
		while(sscanf(cTemp,"WT%d-B%d-%d %n",&a,&b,&c,&n) != EOF)
		{
			cTemp += n;
			t++;
		}
		inDegreeRank[t]++;
	}
	fclose(fr);
	fw = fopen("../res/In_Degree_Result","w");
	for(i = 0;i < 100;i++)
		fprintf(fw,"%d\n",inDegreeRank[i]);
	fclose(fw);
	return 0;
}
